<script>
    $(function() {
        $( ".calendario" ).datepicker();
    });
</script>
<?php echo $this->Form->create('AccountObligation'); ?>
<fieldset>
    <legend><?php echo __('ADICIONAR ACTIVIDAD'); ?></legend>
    <?php
    echo $this->Form->input('descripcion_acciones', array('label' => 'Descripción actividad', 'class' => 'txtarea'));
    echo $this->Form->input('AccountObligation.estado', array('label' => 'Estado actividad', 'empty' => '', 'options' => array('Iniciada' => 'Iniciada', 'En ejecución' => 'En ejecución', 'Aplazada' => 'Aplazada', 'Culminada' => 'Culminada')));
    echo $this->Form->input('documentos_soporte', array('label' => 'Documentos soporte (Fisico)', 'class' => 'txtarea'));
    echo $this->Form->input('AccountObligation.soportes_magneticos', array('label' => 'Documentos soporte (Magnético)', 'class' => 'txtarea'));
    echo $this->Form->input('fecha_inicio', array('label' => 'Fecha inicio', 'class' => 'calendario', 'type' => 'text'));
    echo $this->Form->input('fecha_cierre', array('label' => 'Fecha finalización', 'class' => 'calendario', 'type' => 'text'));
    echo $this->Form->input('obligation_id', array('label' => 'Tipo de obligación.'));
    echo $this->Form->hidden('account_id');
    ?>
</fieldset>

<?php
echo $this->Ajax->submit('Guardar', array('url' => array('controller' => 'AccountObligations', 'action' => 'add', $this->data['AccountObligation']['account_id']), 'update' => 'content', 'indicator' => 'loading'));
echo $this->Form->end();
echo $this->Ajax->link($this->Html->image("regresar.gif", array('width' => '30', 'heigth' => '30', 'alt' => 'Regresar')), array('controller' => "AccountObligations", "action" => "index", $this->data['AccountObligation']['account_id']), array('update' => 'content', 'indicator' => 'loading', 'escape' => false), null)
?>